from selenium import webdriver
from selenium.webdriver.common.by import By
import time

driver=webdriver.Edge()
driver.get('https://126.com/')
time.sleep(3)
driver.switch_to.frame(driver.find_element(By.XPATH,'//iframe[starts-with(@id,"x-URS-iframe")]'))
time.sleep(3)
driver.find_element(By.NAME,'email').send_keys('L13012558376')
driver.find_element(By.NAME,'password').send_keys('liushuai370283LS')
driver.find_element(By.ID,'dologin').click()
time.sleep(5)
driver.switch_to.default_content()
driver.find_element(By.XPATH,'//*[@id="_mail_component_98_98"]/span[2]').click()
time.sleep(5)
driver.find_element(By.CLASS_NAME,'nui-editableAddr-ipt').send_keys('2018675435@qq.com')
time.sleep(5)
driver.find_element(By.XPATH,'//input[contains(@id,"subjectInput")]').send_keys('发送发送')
time.sleep(5)
driver.switch_to.frame(driver.find_element(By.CLASS_NAME,'APP-editor-iframe'))
time.sleep(3)
driver.find_element(By.CLASS_NAME,'nui-scroll').send_keys('UI自动化')
time.sleep(3)
# 退出框架
driver.switch_to.default_content()
driver.find_element(By.CLASS_NAME,'nui-btn-text').click()
time.sleep(5)